package com.wangxl.girl.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.wangxl.girl.properties.GirlProperties;

@RestController
public class HelloController
{
	@Autowired
	private GirlProperties girlProperties;
	/**
	 * 	获取URL中的数据   @PathVariable
	 * @param id
	 * @return 
	 */
	/*@RequestMapping(value="/{id}/hello",method=RequestMethod.GET)
	public String  say(@PathVariable("id") Integer id)
	{
		return "id:"+id;
		
	}*/
	/**
	 *   获取请求参数的值  @RequestParam("id")
	 * @param myid
	 * @return
	 */
	/*@RequestMapping(value="/hello",method=RequestMethod.GET)
	public String  say(@RequestParam(value="id",required=false,defaultValue="0")  Integer myid)
	{
		return "id:"+myid;
		
	}*/
	/**
	 *         @GetMapping(value="/hello") & @PostMapping("/hello")
	 * @param myid
	 * @return
	 */
	//@RequestMapping(value="/hello",method=RequestMethod.GET)
	//@PostMapping("/hello")
	@GetMapping(value="/hello")
	public String  say(@RequestParam(value="id",required=false,defaultValue="0")  Integer myid)
	{
		return "id:"+myid;
		
	}

}
